s = input().split()
n = int(s[0])
target = int(s[1])
nums = [int(x) for x in input().split(" ")]
for i in range(n - 1):
    for j in range(i + 1, n):
        if nums[i] + nums[j] == target:
            print("%d %d" % (i, j))
